<?php
namespace app\common\component\user_lottery_loading;

use app\common\model\UserLotteryLoading;

class UserLotteryLoadingService {
	public function getUserLotteryLoading($userId) {
		$getUserLotteryLoading = UserLotteryLoading::get(['user_id' => $userId]);

		if(!$getUserLotteryLoading) {
			$data['user_id'] = $userId;
			$data['lottery_1_loading'] = 0;
			$data['lottery_2_loading'] = 0;
			$getUserLotteryLoading = new UserLotteryLoading($data);
			$getUserLotteryLoading -> save();
		}
		return $getUserLotteryLoading;
	}
}
?>